<template>
	<div>
		
		<el-breadcrumb separator-class="el-icon-arrow-right">
		  <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
		  <el-breadcrumb-item>常规管理</el-breadcrumb-item>
		  <el-breadcrumb-item>基础配置</el-breadcrumb-item>
		</el-breadcrumb>
		
		<el-card class="box-card">
			<el-form label-width="100px" :model="form">
				<el-form-item label="公司名称" prop="company">
					<el-input v-model="form.company" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="公司邮箱" prop="email">
					<el-input v-model="form.email" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="公司电话" prop="telephone">
					<el-input v-model="form.telephone" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="公司地址" prop="address">
					<el-input v-model="form.address" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="营业时间" prop="business_hours">
					<el-input v-model="form.business_hours" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="网站标题" prop="seo_title">
					<el-input v-model="form.seo_title" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="网站关键词" prop="seo_keywords">
					<el-input v-model="form.seo_keywords" autocomplete="off"></el-input>
				</el-form-item>				
				<el-form-item label="网站描述" prop="seo_description">
					<el-input v-model="form.seo_description" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="版权信息" prop="copyright">
					<el-input v-model="form.copyright" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="备案号" prop="icp">
					<el-input v-model="form.icp" autocomplete="off"></el-input>
				</el-form-item>
				
				<el-form-item>
					<el-button type="primary" size="medium " class="btn" @click="submit">保存</el-button>
				</el-form-item>
			</el-form>
			
			
		</el-card>
		
	</div>
	
</template>

<script>
export default {
	data(){
		return {
			form:{
				company:'',
				email:'',
				telephone:'',
				address:'',
				business_hours:'',
				seo_title:'',
				seo_keywords:'',
				seo_description:'',
				//logo:'',
				copyright:'',
				icp:''
			}
		}
	},
	methods:{
		getData(){
			this.$http.get('config/basics').then(res => {
				if(res.data.code !== 200) return this.$message.error(res.data.msg);	
				this.form = res.data.data;
			});
		},
		submit(){
			this.$http.put('config/basics',this.form).then(res=>{
				if(res.data.code !== 200) return this.$message.error(res.data.msg);	
				this.$message.success(res.data.msg);
				this.getData();
			});
		}
	},
	created(){
		this.getData();
	}
}
</script>

<style>
</style>
